package com.agileai.bpm.service.running;

import java.util.List;

import com.agileai.bpm.domain.define.Process;
import com.agileai.bpm.domain.running.DelegateItem;
import com.agileai.bpm.domain.running.HandleItem;
import com.agileai.bpm.domain.running.InvokeItem;
import com.agileai.bpm.domain.running.LaunchItem;
import com.agileai.bpm.domain.running.ProcessInstance;
import com.agileai.bpm.domain.running.SubmitItem;
import com.agileai.bpm.domain.running.WorkItem;

public interface ProcessHandle {
	public static class UserSeqType{
		public static final String USER_ID = "USER_ID";
		public static final String USER_CODE = "USER_CODE";
	}
	
	public String[] getProcessId8InstId(String processCode,String bizRecordId);
	public String findUserId(String userCode) throws RunningException;
	public String findUserCode(String userId) throws RunningException;
	public String findActivityInstId(String processInstId,String userCode,String activityCode) throws RunningException;
	public String findCurrentProcessId(String processCode) throws RunningException;
	
	public String launchProcess(LaunchItem launchWorkItem,boolean skipFirstNode) throws RunningException;
	
	public void submitProcess(SubmitItem submitItem,ProcessInstance processInstance) throws RunningException;
	public void invokeProcess(InvokeItem invokeItem,ProcessInstance processInstance) throws RunningException;
	
	public void terminateProcess(HandleItem processWorkItem) throws RunningException;
	
	public void suspendProcess(HandleItem processWorkItem) throws RunningException;
	
	public void resumeProcess(HandleItem processWorkItem) throws RunningException;
	
	public void delegateProcess(DelegateItem delegateItem) throws RunningException;
	
	public void saveDraft(String processId,String userId,String bizRecordId,String bizTitle,String bizCode) throws RunningException;
	
	public List<WorkItem> findWorkItemList(String seq,String type) throws RunningException;
	
	public Process retrieveProcess(String processId) throws RunningException;
	
	public ProcessInstance retrieveProcessInstance(String processInstId) throws RunningException;
	
	public boolean isOwnTask(String userId,String processInstanceId,String activityCode) throws RunningException;
	
}
